// number 数值 整数和小数
//string 字符串 （字符）""    ''
//bool     true/false
//null    没有
//undefined   
//symbol   es6

var a=null;//空对象
console.log(typeof a)


//object: 正则，数组  字面量(json对象)
//function 

//json xml
//序列化 反序列化
//JSON.stringify()
//JSON.parse()
var stu =JSON.parse('{"id":10001, "name":"张三"}')
console.log(stu.id)

var a=10;
{
    a=20;
}
console.log(a);

var a=10;
{
    console.log(a);
    a=20;
}


// + - * /
var a = 3-"1";
console.log(a)


var a= 1/"3";
console.log(a)

var a=(0.1*10+0.2*10)/10;
console.log(a==0.3)

// = == ===
console.log(a=2);
console.log(a=="2");
console.log(a==="2");
console.log(a===3);
console.log(a===2);

//parseInt  取整 81.5  81  不是四舍五入
//parseFloat
//isNaN Not a number


var a = parseInt("86.5");
console.log(a)

var a = parseInt("86a.99");
console.log(a)

var a = parseInt("8a6.99");
console.log(a)

var a = parseInt(86.5+0.5);
console.log(a)


//函数
function sum(a,b){
    return a+b;
}

var a = sum(3,4,5);
console.log(a)


//arguments参数数组
function sum(a){
    console.log(arguments)//伪数组 可以使用下标
    console.log(a)
    return 1;
}

var a = sum(3,4,5,8,9);
console.log(a)


var arr=new Array();
arr[0] =0;
arr[1]=1;
arr[2]=2;
console.log(arr)


var arr=[1,"2",3,function(){}]
console.log(arr)

// arr.shift()
// arr.unshift()
// arr.push()
// arr.pop()

var arr = [1,2,3,4,5]
arr.shift()
console.log(arr)

var arr = [1,2,3,4,5]
arr.unshift(3)//头部添加的数字放置其中
console.log(arr)


var arr = [1,2,3,4,5]
var res = arr.pop()
console.log(arr,res)

var arr = [1,2,3,4,5]
//开始位置 删除个数 。。。添加数据
arr.splice(2,1,8,9)
console.log(arr)

